package com.xpsoft.oa.dao.produce.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.produce.MaterialDivertInfoDao;
import com.xpsoft.oa.model.produce.MaterialDivertInfo;

public class MaterialDivertInfoDaoImpl extends BaseDaoImpl<MaterialDivertInfo> implements MaterialDivertInfoDao{

	public MaterialDivertInfoDaoImpl() {
		super(MaterialDivertInfo.class);
	}

	@Override
	public void deleteMaterialDivertInfos(Long divertId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from MaterialDivertInfo where id not in (:ids) and materialDivert.id=:divertId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("divertId", divertId);
		query.executeUpdate();
	}

}